#ifndef WULC_HASH_FIPS202_H_
#define WULC_HASH_FIPS202_H_

#include <stddef.h>
#include <stdint.h>

typedef struct {
    uint64_t s[25];
    unsigned int pos;
} keccak_state;

/*============================================================================*/
/* Constant definitions                                                       */
/*============================================================================*/



/*============================================================================*/
/* Macro definitions                                                          */
/*============================================================================*/

#define SHAKE128_RATE 168
#define SHAKE256_RATE 136
#define SHA3_256_RATE 136
#define SHA3_512_RATE 72

#define FIPS202_NAMESPACE(s) wlc_fips202_ref##s

#define shake128_init FIPS202_NAMESPACE(_shake128_init)
#define shake128_absorb FIPS202_NAMESPACE(_shake128_absorb)
#define shake128_finalize FIPS202_NAMESPACE(_shake128_finalize)
#define shake128_squeezeblocks FIPS202_NAMESPACE(_shake128_squeezeblocks)
#define shake128_squeeze FIPS202_NAMESPACE(_shake128_squeeze)

#define shake256_init FIPS202_NAMESPACE(_shake256_init)
#define shake256_absorb FIPS202_NAMESPACE(_shake256_absorb)
#define shake256_finalize FIPS202_NAMESPACE(_shake256_finalize)
#define shake256_squeezeblocks FIPS202_NAMESPACE(_shake256_squeezeblocks)
#define shake256_squeeze FIPS202_NAMESPACE(_shake256_squeeze)

#define shake128 FIPS202_NAMESPACE(_shake128)
#define shake256 FIPS202_NAMESPACE(_shake256)
#define sha3_256 FIPS202_NAMESPACE(_sha3_256)
#define sha3_512 FIPS202_NAMESPACE(_sha3_512)

/*============================================================================*/
/* Function definitions                                                        */
/*============================================================================*/

#ifdef __cplusplus
extern "C"
{ /* start of __cplusplus */
#endif

void shake128_init(keccak_state *state);

void shake128_absorb(keccak_state *state, const uint8_t *in, size_t inlen);

void shake128_finalize(keccak_state *state);

void shake128_squeezeblocks(uint8_t *out, size_t nblocks, keccak_state *state);

void shake128_squeeze(uint8_t *out, size_t outlen, keccak_state *state);

void shake256_init(keccak_state *state);

void shake256_absorb(keccak_state *state, const uint8_t *in, size_t inlen);

void shake256_finalize(keccak_state *state);

void shake256_squeezeblocks(uint8_t *out, size_t nblocks, keccak_state *state);

void shake256_squeeze(uint8_t *out, size_t outlen, keccak_state *state);

void shake128(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen);

void shake256(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen);

void sha3_256(uint8_t h[32], const uint8_t *in, size_t inlen);

void sha3_512(uint8_t h[64], const uint8_t *in, size_t inlen);


#ifdef __cplusplus
} /* end of __cplusplus */
#endif


#endif //WULC_HASH_FIPS202_H_
